import 'package:boss/color_constant.dart';
import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/page/takeoutManagement/page/businessSetting/page/timeRange/model/hour_minute.dart';
import 'package:hi_common/hi_common.dart';

import 'package:flutter/material.dart';

class BusinessSettingTime extends StatelessWidget {
  final HourMinute start;
  final HourMinute end;
  final VoidCallback onTap;

  const BusinessSettingTime({
    Key key,
    this.onTap,
    this.start,
    this.end,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return DefaultTextStyle(
      style: TextStyleConstant().normal_1_28,
      child: GestureDetector(
        onTap: onTap,
        child: Container(
          height: 110.w,
          decoration: BoxDecoration(
              border: Border(
                  bottom: BorderSide(
            width: 1.px,
            color: ColorConstant.e6e6,
          ))),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              Text('营业时间'),
              RichText(
                text: TextSpan(text: '营业', style: TextStyleConstant().normal_1_28, children: [
                  TextSpan(
                    text: ' ${start?.toString() ?? '请选择'} ',
                    style: TextStyleConstant().normal_3_28,
                  ),
                  TextSpan(
                    text: '至',
                  ),
                  TextSpan(
                    text: ' ${end?.toString() ?? '请选择'} ',
                    style: TextStyleConstant().normal_3_28,
                  ),
                  TextSpan(text: '休息'),
                ]),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
